
(vector-copy '#(a b c d e f g h i))	; => #(a b c d e f g h i)

(vector-copy '#(a b c d e f g h i) 6)	; => #(g h i)

(vector-copy '#(a b c d e f g h i) 3 6)	; => #(d e f)

(let ((t (vector 1 2 0 0 5))
      (d (vector 0 0 3 4 0)))
  (vector-copy! t 2 d 2 4)
  t)					; => #(1 2 3 4 5)

(vector-expand 'a 0)			; => ERROR

(map 
 vector-expand 
 '(a a #(a b c) #(a b c))
 '(1 4 3        4 ))			

;; => (#(a) #(a a a a) #(a b c) #(a b c a))

(map
 vector-expand 
 '(#(a b c) #(a b c) #(a b c))
 '(5        6        13))		

;; => (#(a b c a b) 
;;     #(a b c a b c) 
;;     #(a b c a b c a b c a b c a))

(vector-rotate #(4 5 6 7) 1)		; #(5 6 7 4)

(vector-rotate #(1 2) -1)		; #(2 1)

(vector-rotate #(1 2) 1)		; #(2 1)

(map 
 (lambda (index)
   (vector-ref-wrap '#(0 1 2) index))
 '(4 -1 9))				; => (1 2 0)

(vector-ref-right '#(0 1 2 3) 1)	; => 2

(vector-shuffle! 
 (lambda (l r) 
   (randomI l r)) 
 '#(1 2 3 4 5 6))			; => RANDOM, #(3 1 2 5 6 4)

(vector-map (lambda (i a) 
	      (- a)) 
	    #(4 5 6))			; => #(-4 -5 -6)

(vector-map (lambda (i a b) 
	      (cons a b))
	    #(1 2 3)
	    #(3 2 1))	; => #((1 . 3) (2 . 2) (3 . 1))

(vector-for-each (lambda (i a) 
		   (display (- a))) 
		 #(4 5 6))		; => DISPLAYS -4-5-6

(vector-apply + 
	      #(4 5 6 7))		; => 22

(vector-index (lambda (e) 
		(equal? e 'c))
	      '#(a b c d e))		; => 2

(vector-index/start+end 
 (lambda (e) 
   (equal? e 'e))
 '#(a b c d e)
 1 4)					; => #f

(vector-index/start+end 
 (lambda (e) 
   (equal? e 'd))
 '#(a b c d e)
 3 4)					; => 3

(vector-find (lambda (element) 
	       (equal? element 'c))
	     '#(a b c d e))		; => c

(vector-uniform number? 
		'#(0 2 5 6))		; => #t

(vector-uniform number? 
		'#(0 2 'a 5 6)) 	; => #f

(vector-tabulate* 5 
		 (lambda (index) 
		   (+ index 1)))	; => #(1 2 3 4 5)

(vector-tabulate* 5 
		 (lambda () 1))	; => #(1 1 1 1 1)

(vector-flatten-one-layer
 #(#(1 2 3 4) #(5 6) #(7 8 9)))		; => #(1 2 3 4 5 6 7 8 9)

(vector-flatten-one-layer
 #(#(1 2) #(3) #(4) #(5 6) #(7 8 9)))	; => #(1 2 3 4 5 6 7 8 9)

(vector-flatten-one-layer
 #(#(1 2) 3 4 #(5 6) 7 #(8 9)))		; => #(1 2 3 4 5 6 7 8 9)

(vector-flatten-one-layer
 #(#(1 2 #(3)) 4 #(5 6) 7 #(8 9)))	; => #(1 2 #(3) 4 5 6 7 8 9)

(vector-apply 
 +
 (vector-map 
  vector-length-or-one 
  #()))					; => 0

(vector-traverse
 '#(4 3 2 1 0)
 (lambda (i e) (display (list i e))))	; =| (0 4)(1 3)(2 2)(3 1)(4 0)

(vector-mutate!
 '#(4 3 2 1 0)
 (lambda (i e) (+ (* i 2) e)))		; => #(4 5 6 7 8)

;; tests for 'vector-transfer-function-lookup' are under the list
;; variant.

(let ((v (vector 0 1 2 3 4)))
  (vector-reverse! v)
  v)					; => #(4 3 2 1 0)

(map (lambda (n) (vector-permute #(0 1 2) n))
     (iota 6))

(vector-tabulate 4 -)			; => #(0 -1 -2 -3)

(vector-max #(4 7 3 5 3))		; => 7
(vector-min #(4 7 3 5 3))		; => 3
